var cph ='',openid = '';
$(function() {
	openid = localStorage.getItem("openid");
	$.ajax({
		url: '/park/data/getUserInfo?openid='+openid+'&type=2',
		type: 'post',
		dataType: 'json',
		success: function(res) {
			if(res.data!=null){
				cph = res.data.cph;
				layer.open({
			    type: 2
			    ,content: '加载中'
			  });
			$.ajax({
				url : '/park/road/data/getRoadParkHistory',
				type : 'post',
				data : 'carLicense=' + cph,
				dataType : 'json',
				success : function(res) {
					layer.closeAll();
					$('#bbbb').show();
					if (res.data.status != '0' ) {
						layer.open({
							content : res.data.msg,
							skin : 'msg',
							time : 2
						//2秒后自动关闭
						});
					} else {
						$('#data').show();
						for(var i in res.data.attr.result){
							res.data.attr.result[i].num = parseInt(i)+1;
							var time = res.data.attr.result[i].startTime;
							res.data.attr.result[i].startTime = time.substring(0,4)+'-'+time.substring(4,6)+'-'+time.substring(6,8)+' '+time.substring(8,10)+':'+time.substring(10,12)+':'+time.substring(12,14)
							var time = res.data.attr.result[i].endTime;
							if(time!=null&&time!=''){
								res.data.attr.result[i].endTime = time.substring(0,4)+'-'+time.substring(4,6)+'-'+time.substring(6,8)+' '+time.substring(8,10)+':'+time.substring(10,12)+':'+time.substring(12,14)
							}
						}
						new Vue({
							el : '#data',
							data : {
								datas : res.data.attr.result
							}
						})
					}
				}
			})
			}else{
				layer.open({
					content : '未关联车牌信息！',
					skin : 'msg',
					time : 2
				//2秒后自动关闭
				});
			}
		}
	})
})
function  _go(_e){
	var orderNo = $(_e).attr('id');
	location.href = '/park/r_orderDetail?orderNo='+orderNo;
}
function goBack() {
	location.href = "/park/r_index";
}